import request from '@/utils/request'
import qs from 'qs'

/**
 * 获取列表
 * @param limit
 * @param offset
 */
export function page(limit, offset, sjcdwmc) {
  return request({
    url: '/system/tableThree/getPage',
    method: 'post',
    data: qs.stringify({
      limit,
      offset,
      sjcdwmc
    })
  })
}

/**
 * 编辑或保存
 * @param id
 * @param name
 * @param imgJson
 * @param showState
 */
export function addOrEdit(id,
                          tableOneId,
                          dcrq,
                          gzcsgznr,
                          dcr,
                          sjdwptr,
                          table1Json) {
  return request({
    url: '/system/tableThree/addOrEdit',
    method: 'post',
    data: qs.stringify({
      id,
      tableOneId,
      dcrq,
      gzcsgznr,
      dcr,
      sjdwptr,
      table1Json
    })
  })
}

/**
 * 删除
 * @param id
 */
export function del(id) {
  return request({
    url: '/system/tableThree/del',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

export function getInfo(id) {
  return request({
    url: '/system/tableThree/getInfo',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}
